module.exports = {
    devtool: 'eval-source-map',
    entry: __dirname + "/app.js",
    output: {
        // path: __dirname + "/public",
        filename: "main.js"
    },
    devServer: {
        // contentBase: "./public", //本地服务器所加载的页面所在的目录
        historyApiFallback: true, //不跳转
        inline: true, //实时刷新
    },
    module: {
        rules: [{
                test: /\.css$/,
                use: [
                    { loader: "style-loader" },
                    { loader: "css-loader" }
                ]
            },
            {
                test: /\.(jpg|png|gif|jpeg)$/,
                use: [{
                    loader: 'url-loader',
                    options: {
                        limit: 50000 //1000代表1kb
                    }
                }]
            },
            {
                test: /\.(ttf|eot|woff|woff2|svg)/,
                use: ['file-loader']
            }
        ]
    }
}